# Maintainer: Kyle Keen <keenerd@gmail.com>
# Contributor: LaraCraft304 <lara@craft.net.br>
# Contributor: Mateusz Herych <heniekk@gmail.com>

pkgname=read-edid
pkgver=3.0.2
pkgrel=4
pkgdesc="Program that can get information from a PNP monitor"
arch=('loong64' 'x86_64')
url="http://www.polypux.org/projects/read-edid/"
license=('GPL')
depends=('libx86>=0.99')
makedepends=('cmake')
source=("http://www.polypux.org/projects/$pkgname/$pkgname-$pkgver.tar.gz")
md5sums=('016546e438bf6c98739ff74061df9854')
sha256sums=('c7c6d8440f5b90f98e276829271ccea5b2ff5a3413df8a0f87ec09f834af186f')

prepare() {
    mkdir $pkgname-build

    # bug in 3.0.2
    sed -i 's/COPYING/LICENSE/' $pkgname-$pkgver/CMakeLists.txt
}

build() {
    cd $pkgname-build
    CFLAGS+=' -fcommon' # https://wiki.gentoo.org/wiki/Gcc_10_porting_notes/fno_common
    cmake "$srcdir/$pkgname-$pkgver" -DCMAKE_INSTALL_PREFIX="/usr"
    make
}

package() {
    cd $pkgname-build
    make DESTDIR="$pkgdir/" install
}
